//reset
@import './variables';
*{
    box-sizing: border-box;
    outline:none;
}

html{
    font-size: 13px;
}

body{
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.2em;
    background: #f1f1f1;
}

.w-100{
    width: 100%;
}

.h-100{
    height: 100%;
}

a{
    color: #999999;
}

p{
    line-height: 1.5em;
}

.text-ellipsis {
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@each $colorkey,$color in $colors {
    .text-#{$colorkey}{
        color: $color
    }
    .bg-#{$colorkey}{
        background-color: $color
    }
}

@each $var in (left,center,right) {
    .text-#{$var}{
        text-align: $var !important;
    }
}

@each $sizeKey,$size in $font-sizes {
    .fs-#{$sizeKey}{
        font-size:$size * $base-font-size
    }
}

//flex
.flex-column{
    flex-direction: column;
}

.flex-wrap{
    flex-wrap: wrap;
}

.flex-1{
    flex: 1;
}

.d-flex{
    display: flex;
}

@each $key,$value in $flex-jc {
    .jc-#{$key}{
        justify-content: $value;
    }
};

@each $key,$value in $flex-ai {
    .ai-#{$key}{
        align-items: $value;
    }
};

@each $dir in (top,bottom,left,right) {
    .border-#{$dir}{
        border-#{$dir}:1px solid $border-color
    }
}

@each $typeKey,$type in $spacing-types {
    @each $sizeKey,$size in $spacing-sizes {
        .#{$typeKey}-#{$sizeKey}{
            #{$type}:$size * $base-font-size
        }
    }
    @each $sizeKey,$size in $spacing-sizes {
        .#{$typeKey}x-#{$sizeKey}{
            #{$type}-left:$size * $base-font-size;
            #{$type}-right:$size * $base-font-size
        }
    }
    @each $sizeKey,$size in $spacing-sizes {
        .#{$typeKey}y-#{$sizeKey}{
            #{$type}-top:$size * $base-font-size;
            #{$type}-bottom:$size * $base-font-size
        }
    }
    @each $directionKey,$direction in $spacing-directions {
        @each $sizeKey,$size in $spacing-sizes {
            .#{$typeKey}#{$directionKey}-#{$sizeKey}{
                #{$type}-#{$direction}:$size * $base-font-size
            }
        }
    }
}

.btn{
    border: none;
    border-radius: 0.1538rem;
    font-size: map-get($font-sizes,'sm') * $base-font-size;
    padding: 0.2rem 0.6rem;
    &.btn-lg{
        display: flex;
        justify-content: center;
        align-items: center;
        i{
            color:map-get($colors, 'primary');
            font-weight: bold;
            font-size: 1.5rem;
            margin-right: 0.5rem;
        };
        .iconfont{
            color:map-get($colors, 'primary');
            font-weight: bold;
            font-size: 1.5rem;
            margin-right: 0.5rem;
        }
        background: map-get($colors, 'white-1');
        border:1px solid map-get($colors, 'white-2');
        padding: 0.8rem 1rem;
        font-size: 1rem;
    }
}

.nav{
    display: flex;
    .nav-item{
        border-bottom:3px solid transparent;
        padding-bottom: 0.2rem;
        &.active{
            color: map-get($colors ,'primary');
            border-bottom-color: map-get($colors ,'primary');
        }
    }
    &.nav-inverse{
        .nav-item{
            color: map-get($colors ,'white');
            &.active{
                border-bottom-color: map-get($colors ,'white');
            }
        }
    }
}

.sprite{
    background: url(../images/index.png) no-repeat 0 0;
    background-size: 28.8462rem;
    display: inline-block;
    &.sprite-news{
        width: 1.7692rem;
        height: 1.5385rem;
        background-position: 63.546% 15.517%;
    }
    &.sprite-story{
        width: 1.7692rem;
        height: 1.5385rem;
        background-position: 90.483% 15.614%;
    }
    &.sprite-shop{
        width: 1.4615rem;
        height: 1.6923rem;
        background-position: 36.746% 0.924%;
    }
    &.sprite-tiyanfu{
        width: 1.5385rem;
        height: 1.5385rem;
        background-position: 10.408% 15.517%;
    }
    &.sprite-newpeople{
        width: 1.5385rem;
        height: 1.6154rem;
        background-position: 89.733% 1.266%;
    }
    &.sprite-rongyao{
        width: 1.8462rem;
        height: 1.5385rem;
        background-position: 36.467% 15.287%;
    }
    &.sprite-tongren{
        width: 2rem;
        height: 1.6154rem;
        background-position: 9.728% 1.266%;
    }
    &.sprite-yingdi{
        width: 1.8462rem;
        height: 1.8462rem;
        background-position: 63.3% 0.927%;
    }
    &.sprite-gongzhonghao{
        width: 1.8462rem;
        height: 1.5385rem;
        background-position: 0 96.207%;
    }
    &.sprite-arrow{
        width: 0.7692rem;
        height: 0.7692rem;
        background-position: 38.577% 52.076%;
    }
}